<?php
namespace app\home\model;
use think\Model;
class Article extends Model
{
    public function user()
    {
        return $this->belongsTo('user','user_id','id');
    }

    public function category()
    {
        return $this->hasOne('category','id','category_id');
    }

    //主表和附表关联
    public function articleDetail()
    {
        return  $this->hasOne('articleDetail','article_id','id');
    }


}
